/*////////////////////////////////////////////////////////////////////////
*
*  Project:      mapgenUI
*  Description:  UI created in Qt for Map Generator.
*  Author:       Copyright (C) 2010 Alexander Makodzeba
*  License:      GPLv3
*
*  This file is part of mapgen.
*
*  mapgen is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  mapgen is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with mapgen.  If not, see <http://www.gnu.org/licenses/>.
*
////////////////////////////////////////////////////////////////////////*/

#ifndef MAINDIALOG_H
#define MAINDIALOG_H

#include <QDialog>
#include <QProcess>

namespace Ui {
    class MainDialog;
}

class MainDialog : public QDialog
{
    Q_OBJECT

public:
    explicit MainDialog(QWidget *parent = 0);
    ~MainDialog();

private:
    Ui::MainDialog *ui;
    QProcess process;

private slots:
    void on_btnGenerate_clicked();
    void on_btnMapGenPath_clicked();

    void processStandardOutputReady();
    void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
    void processError(QProcess::ProcessError error);

private:
    void AddLog(QString sLog);
    void StartProcess();
    void ShowBrowsePath();
};

#endif // MAINDIALOG_H
